//
//  GoShopCardTableViewCell.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/8.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "GoShopCardTableViewCell.h"

@interface GoShopCardTableViewCell ()
@property (weak, nonatomic) IBOutlet UIButton *selectBtn;
@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UILabel *discri;
@property (weak, nonatomic) IBOutlet UILabel *amount;
@property (weak, nonatomic) IBOutlet UILabel *peopleNumber;
@property (weak, nonatomic) IBOutlet UILabel *number;
@property (weak, nonatomic) IBOutlet UILabel *money;
@property (weak, nonatomic) IBOutlet UIButton *collect;


- (IBAction)selectBtnClick:(id)sender;//选中当前cell
- (IBAction)plus:(id)sender;//数量减少1
- (IBAction)add:(id)sender;//数量增加1
- (IBAction)delete:(id)sender;//删除事件
- (IBAction)collectBtn:(id)sender;//收藏事件

@end

@implementation GoShopCardTableViewCell

- (void)awakeFromNib {
    // Initialization code
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

//选中商品点击按钮
- (IBAction)selectBtnClick:(id)sender {
}

- (IBAction)plus:(id)sender {
}

- (IBAction)add:(id)sender {
}

- (IBAction)delete:(id)sender {
}

- (IBAction)collectBtn:(id)sender {
}

+ (instancetype) GoShopCardWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"cell";
    GoShopCardTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"GoShopCardTableViewCell" owner:nil options:nil] lastObject];
    }
    return cell;
}
- (void)setDic:(NSDictionary *)dic
{
    _dic = dic;
    self.image.image = [UIImage imageNamed:dic[@"image"]];
    self.discri.text = dic[@"discri"];
    self.amount.text = dic[@"amount"];
    self.peopleNumber.text = dic[@"peopleNumber"];
    self.number.text = dic[@"number"];
    self.money.text = dic[@"money"];
    [self.collect setTitle:dic[@"collect"] forState:UIControlStateNormal];
}

@end
